package org.liuyuantao.data.basic;

/**
 * 使用构造代码块模拟死循环
 */
public class StaticCode {

    static {
        System.out.println("执行静态代码块");
    }

    {
        System.out.println("执行构造代码块");
        new StaticCode();
    }

    public StaticCode() {
        System.out.println("执行构造函数");
    }

    public void sayHello() {
        System.out.print("hello");
    }

    public static void main(String[] args) {
        StaticCode code = new StaticCode();
        code.sayHello();
    }
}
